﻿<%@ Page Title="ADO.Net" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ADO-Net.aspx.cs" Inherits="Stanford.Demo.Demo_ADO.Net.ADO_Net" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table>
        <tr>
            <td>
                Tên đăng nhập
            </td>
            <td>
                <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Mật khẩu
            </td>
            <td>
                <asp:TextBox ID="txtPass" runat="server" TextMode="Password"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Button ID="btnLogin" runat="server" OnClick="btnLogin_Click" Text="Đăng nhập"></asp:Button>
                <asp:Label ID="lbThongBao" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td>
                Lấy dữ liệu bằng phương thức ExecuteReader()
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="grvData" runat="server">
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvStudent" runat="server" AutoGenerateColumns="false" DataKeyNames="ID">
                    <Columns>
                        <asp:BoundField DataField="ID" HeaderText="ID" />
                        <asp:BoundField DataField="St_Name" HeaderText="Tên học viên" />
                        <asp:ImageField DataImageUrlField="St_Age" HeaderText="Tuổi">
                        </asp:ImageField>
                        <asp:BoundField DataField="St_Class" HeaderText="Lớp" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    Lấy dữ liệu bằng phương thức ExecuteReader()
    <%=Html %>
</asp:Content>
